package org.jtb.quickr;

import java.io.InputStream;
import java.util.Map;

class PhotosGetSizesRequest extends MethodRequest {
    private String photoId;
    
    protected PhotosGetSizesRequest(String baseUrl, String apiKey, String photoId) throws QuickrException {
        super(baseUrl, apiKey, "flickr.photos.getSizes");
        this.photoId = photoId;
    }
    
    
    protected Map<String,String> getArgs() {
        putArg("photo_id", photoId);
        
        return super.getArgs();
    }
    
    public SizesResponse execute() throws QuickrException {
        FlickrUrl furl = new ServiceMethodUrl(getBaseUrl(), getArgs(), getApiKey(), getMethod());
        
        Get get = new Get(furl.getUrl());
        InputStream is = get.execute();
        
        SizesResponse sres = new SizesResponse(is);
        
        return sres;
    }
}
